package org.github.p2w.constant;

import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;

/**
 * 常量
 *
 * @author xiayc
 * @date 2022/08/02
 */
public class Constant {

    /**
     * 配置文件路径
     */
    public static final String CONFIG_PATH = "config.yml";

    /**
     * get请求
     */
    public static final String GET = "GET";

    public static final String NAME_INDEX_FLAG = ".";

    /**
     * 表格标题
     */
    public static final List<String> TABLE_TITLE = Arrays.asList("接口名称", "接口地址", "Headers", "请求方式", "参数", "请求结果");

    /**
     * 表格中对内容需要换行的标题
     */
    public static final List<String> TABLE_BREAK = Arrays.asList("Headers", "参数", "请求结果");

    /**
     * 表格列宽度，表格只有两列
     */
    public static final int[] TABLE_COLUMN_WIDTH = new int[] {1100, 7000};

    /**
     * 表格宽度
     */
    public static final int TABLE_WIDTH = 8150;

    /**
     * 表格边框样式
     */
    public static final STBorder.Enum TABLE_BORDER_STYLE = STBorder.SINGLE;

    /**
     * 环境字符正则表达式
     */
    public static final String ENV_REG = "\\{\\{.+?\\}\\}";

    public static final Pattern ENV_REG_PATTERN = Pattern.compile(ENV_REG);

    /**
     * 标签正则表达式
     */
    public static final String TAG_REG = "【.+?】";

    public static final Pattern TAG_REG_PATTERN = Pattern.compile(TAG_REG);

    /**
     * 环境字符开始标志
     */
    public static final String ENV_START = "{{";

    /**
     * 环境字符结束标志
     */
    public static final String ENV_END = "}}";

}
